// 类 [Class]

export { }

class Person {

    public name: string

    private age: number // 私有属性，外界无法访问

    protected gender: boolean // protected 只允许子类访问

    private constructor(name: string, age: number) {
        this.name = name
        this.age = age
        this.gender = true
    }

    sayHi(msg: string): void {
        console.log(`I am ${this.name} age ${this.age}`)
    }
}

